<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="CameraCreateDlg" widgetVar="CameraCreateDialog" modal="true" resizable="false" appendToBody="true" header="#{myBundle.CreateCameraTitle}" closeOnEscape="true">

            <h:form id="CameraCreateForm">

                <h:panelGroup id="display">
                    <p:panelGrid columns="2">
                        <p:outputLabel value="#{myBundle.CreateCameraLabel_elemento}" for="elemento" />
                        <p:selectOneMenu id="elemento" value="#{cameraController.selected.elemento}" required="true" requiredMessage="#{myBundle.EditCameraRequiredMessage_elemento}" converter="elementoConverter">
                            <f:selectItem itemLabel="#{myBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{elementoController.items}"
                                           var="elementoItem"
                                           itemValue="#{elementoItem}"
                                           itemLabel="#{elementoItem.idELEMENTO.toString()}"
                                           />

                        </p:selectOneMenu>

                        <p:outputLabel value="#{myBundle.CreateCameraLabel_persone}" for="persone" />
                        <p:inputText id="persone" value="#{cameraController.selected.persone}" title="#{myBundle.CreateCameraTitle_persone}" required="true" requiredMessage="#{myBundle.CreateCameraRequiredMessage_persone}"/>

                        <p:outputLabel value="#{myBundle.CreateCameraLabel_iniziodisp}" for="iniziodisp" />
                        <p:calendar id="iniziodisp" pattern="MM/dd/yyyy" value="#{cameraController.selected.iniziodisp}" title="#{myBundle.EditCameraTitle_iniziodisp}" required="true" requiredMessage="#{myBundle.EditCameraRequiredMessage_iniziodisp}" showOn="button"/>

                        <p:outputLabel value="#{myBundle.CreateCameraLabel_finedisp}" for="finedisp" />
                        <p:calendar id="finedisp" pattern="MM/dd/yyyy" value="#{cameraController.selected.finedisp}" title="#{myBundle.EditCameraTitle_finedisp}" required="true" requiredMessage="#{myBundle.EditCameraRequiredMessage_finedisp}" showOn="button"/>

                        <p:outputLabel value="#{myBundle.CreateCameraLabel_prezzo}" for="prezzo" />
                        <p:inputText id="prezzo" value="#{cameraController.selected.prezzo}" title="#{myBundle.CreateCameraTitle_prezzo}" required="true" requiredMessage="#{myBundle.CreateCameraRequiredMessage_prezzo}"/>

                        <p:outputLabel value="#{myBundle.CreateCameraLabel_descrizione}" for="descrizione" />
                        <p:inputText id="descrizione" value="#{cameraController.selected.descrizione}" title="#{myBundle.CreateCameraTitle_descrizione}" size="255" maxlength="255"/>

                        <p:outputLabel value="#{myBundle.CreateCameraLabel_idHOTEL}" for="idHOTEL" />
                        <p:selectOneMenu id="idHOTEL" value="#{cameraController.selected.idHOTEL}" required="true" requiredMessage="#{myBundle.EditCameraRequiredMessage_idHOTEL}" converter="hotelConverter">
                            <f:selectItem itemLabel="#{myBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{hotelController.items}"
                                           var="idHOTELItem"
                                           itemValue="#{idHOTELItem}"
                                           itemLabel="#{idHOTELItem.idHOTEL.toString()}"
                                           />

                        </p:selectOneMenu>

                    </p:panelGrid>
                    <p:commandButton actionListener="#{cameraController.saveNew}" value="#{myBundle.Save}" update="display,:CameraListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,CameraCreateDialog);"/>
                    <p:commandButton value="#{myBundle.Cancel}" onclick="CameraCreateDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
